#pragma once


enum t_proxy
{
	PROXY_NONE = 0,
	PROXY_HTTP,
	PROXY_SOCKS4,
	PROXY_SOCKS5,
};

enum t_config_version
{
	VERSION_0107 = 0x107,
	VERSION_LAST = 0x108,
};

class lyrics_grabber_config_item
{
public:
	void set_default_value();
	inline lyrics_grabber_config_item() {set_default_value();}

public:
	pfc::string8 lyric_filed_name;
	bool skip_tag_present;
	t_uint32 proxy_type;
	bool proxy_need_auth;
	pfc::string8 proxy_hostport, proxy_username, proxy_password;
	GUID preferred_provider;
};

class cfg_lyrics_grabber : public cfg_var
{
private:
	static const t_uint32 VERSION_CURRENT = VERSION_LAST;

public:
	explicit inline cfg_lyrics_grabber(const GUID & p_guid) : cfg_var(p_guid) {}

	inline lyrics_grabber_config_item & val() {return m_val;}
	inline lyrics_grabber_config_item const & val() const {return m_val;}

protected:
	void get_data_raw(stream_writer * p_stream,abort_callback & p_abort);
	void set_data_raw(stream_reader * p_stream,t_size p_sizehint,abort_callback & p_abort);

	lyrics_grabber_config_item m_val;
};

extern cfg_lyrics_grabber g_cfg_lyrics_grabber;

// Helper
inline lyrics_grabber_config_item & get_lyrics_grabber_config()
{
	return g_cfg_lyrics_grabber.val();
};
